const Qs = require('qs');
// 统一接口
class Service {
    // 获取楼栋数据接口
    getTAndAByUnitId(Self,Param){
        return Self.$axios({
            method:'post',
            url:`/fsScreen/deviceMonitor/getTAndAByUnitId`,
            data: Qs.stringify(Param)
        }).then(
            (response) =>response, (error) =>error
        );
    }

    // 获取楼层数据接口
    getTAndAByUnitIdAndBuildId(Self, Param) {
        return Self.$axios({
            method: 'post',
            url: `/fsScreen/deviceMonitor/getTAndAByUnitIdAndBuildId`,
            data: Qs.stringify(Param)
        }).then(
            (response) => response, (error) => error
        );
    }

    // 获取楼层对应的点位数据 
    getDeviceListByCondition(Self, Param) {
        return Self.$axios({
            method: 'post',
            url: `/fsScreen/deviceMonitor/getDeviceListByCondition`,
            data: Qs.stringify(Param)
        }).then(
            (response) => response, (error) => error
        );
    }

    // 获取楼层高警情点位数据
    getHeightAlarmDeviceListBYCondition(Self, Param){
        return Self.$axios({
            method: 'post',
            url: `/fsScreen/deviceMonitor/getDeviceListByConditionHighRisk`,
            data: Qs.stringify(Param)
        }).then(
            (response) => response, (error) => error
        );
    }

    // 获取设备图标配置信息 
    getDeviceIcons(Self, Param) {
        return Self.$axios({
            method: 'get',
            url: `/image/deviceIcons.json`,
            data: Qs.stringify(Param)
        }).then(
            (response) => response, (error) => error
        );
    }

    // 查询设备的基本信息
    getMoniterDevice(Self, Param) {
        return Self.$axios({
            method: 'post',
            url: `/fsScreen/deviceMonitor/getMoniterDevice`,
            data: Qs.stringify(Param)
        }).then(
            (response) => response, (error) => error
        );
    }

    // 异常记录
    getExceptionRecord(Self, Param) {
        return Self.$axios({
            method: 'post',
            url: `/fsScreen/deviceMonitor/getExceptionRecord`,
            data: Qs.stringify(Param)
        }).then(
            (response) => response, (error) => error
        );
    }

    // 设备水压/电压曲线
    getMonitorNotesByTime(Self, Param) {
        return Self.$axios({
            method: 'post',
            url: `/fsScreen/deviceMonitor/getMonitorNotesByTime`,
            data: Qs.stringify(Param)
        }).then(
            (response) => response, (error) => error
        );
    }

    // echarts 接口
    getMonitoringObject(Self, Param) {
        return Self.$axios({
            method: 'post',
            url: `/fsScreen/deviceMonitor/getMonitoringObject`,
            data: Qs.stringify(Param)
        }).then(
            (response) => response, (error) => error
        );
    }

    // echarts 接口
    getDeviceByMonitoringObject(Self, Param) {
        return Self.$axios({
            method: 'post',
            url: `/fsScreen/deviceMonitor/getDeviceByMonitoringObject`,
            data: Qs.stringify(Param)
        }).then(
            (response) => response, (error) => error
        );
    }

    // 获取实时读数
    getMeasurement(Self, Param) {
        return Self.$axios({
            method: 'post',
            url: `/fsScreen/deviceMonitor/getMeasurement`,
            data: Qs.stringify(Param)
        }).then(
            (response) => response, (error) => error
        );
    }

    // 获取设备类型列表
    getDevicetypes(Self, Param) {
        return Self.$axios({
            method: 'post',
            url: '/fsScreen/deviceMonitor/devicetypes',
            data: Qs.stringify(Param)
        }).then(
            (response) => response, (error) => error
        )
    }

}
export default new Service()
